package com.ahuan.service.Impl;

import com.ahuan.domain.Role;
import com.ahuan.mapper.RoleMapper;
import com.ahuan.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoleServiceImpl implements RoleService {

    @Autowired
    RoleMapper roleMapper;
    public List<Role> queryRoleList(){
        return roleMapper.selectRoleList();
    }

    @Override
    public boolean addRole(Role role) {
        return roleMapper.insertRole(role) > 0;
    }

    @Override
    public boolean editRole(Role role) {
        return roleMapper.updateRole(role) > 0;
    }

    @Override
    public boolean delete(String roleId) {
        return roleMapper.delete(roleId) > 0;
    }
}
